<%@ page import="java.util.ArrayList" %>
<%@ page import="core.Curso" %>
<%@ page import="sql.CursoBD" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Cadastro Turma - SAW</title>
</head>
<body>

<h1> Cadastro de Turmas - SAW </h1>

<%
CursoBD bd = new CursoBD();
ArrayList<Curso> lstCurso = bd.getCursos("");
bd.close();
%>

<p>
<form action="TurmaServlet" method="get">
Nome da Turma: <input type="text" name="nome"><br>
Curso: <select name="curso">
<%
for( int i = 0; i < lstCurso.size(); i++ ) {
%>
	<option value="<%=lstCurso.get(i).getCodigo() %>" > <%=lstCurso.get(i).getNome() %></option>
<%
}
%>
</select><br>
<button type="reset" name="limpar">Limpar</button> <button type="submit" name="cadastrar" value="ok">Cadastrar</button>
</form>
</p>

<p><a href="index.jsp">Home</a></p>
</body>
</html>